package yy.zn.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import yy.zn.entity.R;

/**
 * @author LiuLei
 */
@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler(Throwable.class)
    public R<String> exception(Throwable tb) {
        tb.printStackTrace();
        return R.failed(500, tb.getMessage());
    }

}
